<form action="" id="myform">
<div id="inline1">
	<h2><span>供应商</span></h2>
	<table>
		<tr>
			<th colspan="7">基本信息：</th>
		</tr>
		<tr>
			<td class="name" width="80">供应商：</td>
			<td>&nbsp;</td>
			<td width="170" colspan="5"><?php echo $find_suppliers[0]->name;?></td>
         </tr>
         <tr>
			<td class="name" width="80">类别：</td>
			<td>&nbsp;</td>
			<td width="170" colspan="5"><?php echo $find_suppliers[0]->type;?></td>
         </tr>
         <tr>
			<th colspan="7">联系人信息：</th>
		</tr>
         <tr>
			<td class="name" width="80">联系人：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->contacter_one;?></td>
            <td>&nbsp;</td>

            <td class="name" width="80">联系方式：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->tel_1;?></td>
		</tr>
		<tr>
			<td class="name" width="80">职务：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->post_one;?></td>
			<td>&nbsp;</td>
		</tr>
        <tr>
			<td class="name" width="80">联系人：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->contacter_two;?></td>
            <td>&nbsp;</td>

            <td class="name" width="80">联系方式：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->tel_2;?></td>
		</tr>
		<tr>
			<td class="name" width="80">职务：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->post_two;?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<th colspan="7">供应商信息：</th>
		</tr>
		<tr>
			<td class="name" width="80">区域：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->district;?></td>
			<td>&nbsp;</td>
			<td class="name" width="80">地址：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->address;?></td>
		</tr>
		<tr>
			<td class="name" style="padding:0px;">累计合同金额：</td>
			<td>&nbsp;</td>
			<td width="170"><?php if($find_suppliers[0]->outside_contract_money):?><?php echo $find_suppliers[0]->outside_contract_money;?>万元<?php endif;?></td>
            <td>&nbsp;</td>
            <td class="name" width="80">经营范围：</td>
			<td>&nbsp;</td>
			<td width="170"><?php echo $find_suppliers[0]->operate_scope;?></td>
		</tr>
        <tr>
        	<td class="name" width="80">累计合同：</td>
			<td>&nbsp;</td>
			<td width="170" colspan="5" class="suppliers_list"><span class="suppliers_list_span"><?php if($find_suppliers[0]->outside_contract_nums):?><?php echo $find_suppliers[0]->outside_contract_nums;?>份<?php endif;?></span></td>
		</tr>
        
        <tr id="endtr"><td colspan="5">&nbsp;</td></tr>
	</table>
</div>
<input type="hidden" id="suppliers_id" value="<?php echo $find_suppliers[0]->suppliers_id;?>"/>
<input type="hidden" id="array_value" />
</form>
<script type="text/javascript">
	$(document).ready(function(){
		$("#inline1 table .suppliers_list_span").click(function(){
			$(this).toggleClass("cur");
			$(".suppliers_list_cont").toggle();	
			var suppliers_id_val = $("#suppliers_id").val();
			var array_value_val = $("#array_value").val();
			if(!array_value_val){
				$.ajax({
	                type: "POST",
	                dataType: "text",
	                url: "index.php/suppliers/check_outside_contract",
	                data: "suppliers_id="+suppliers_id_val,
	                success: function(data) {
	                	data=$.parseJSON(data);
	                	$("#array_value").val('1');
	                	var array='',unit = '';
						$.each(data,function(index,nw){
							if(nw.total_amount){
								unit = '万元';
								}
							array+='<tr><td colspan="5">&nbsp;</td></tr>'+
								   '<tr class="suppliers_list_cont">'+
								   '<td colspan="7"><span class="one">主题：</span>'+nw.subject+'<br />'+
								   '<span>对应合同：</span>'+nw.order+'<br />'+
								   '<span>合同金额：</span>'+nw.total_amount+'&nbsp;'+unit+'<br />'+
								   '<span>所有者：</span>'+nw.user_name+'</td>'+
								   '</tr>';
	                	 });
						$("#endtr").before(array);
	                }
	            });
			}
		});	
	});
</script>








